Skip to main content

ResponseParameters Methods

An object defining methods for the ResponseParameters class.

GetValueAsBool(key)

Retrieves the value associated with the specified key as a bool.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: bool
The value associated with the specified key as a bool. If the value is not a valid bool, it returns default(bool).

This is a sync method. Method runs synchronously.


GetValueAsByte(key)

Retrieves the value associated with the specified key as a byte.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: byte
The value associated with the specified key as a byte. If the value is not a valid byte, it returns default(byte).

This is a sync method. Method runs synchronously.


GetValueAsChar(key)

Retrieves the value associated with the specified key as a char.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: char
The value associated with the specified key as a char. If the value is not a valid char, it returns default(char).

This is a sync method. Method runs synchronously.


GetValueAsShort(key)

Retrieves the value associated with the specified key as a short.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: short
The value associated with the specified key as a short. If the value is not a valid short, it returns default(short).

This is a sync method. Method runs synchronously.


GetValueAsInt(key)

Retrieves the value associated with the specified key as a int.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: int
The value associated with the specified key as a int. If the value is not a valid int, it returns default(int).

This is a sync method. Method runs synchronously.


GetValueAsString(key)

Retrieves the value associated with the specified key as a string.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: string
The value associated with the specified key as a string. If the value is not a valid string, it returns default(string).

This is a sync method. Method runs synchronously.


GetValueJsonAsType<T>(key)

Deserializes a JSON string stored under the given key into an object of type T.

Parameters:

key (required): string
The key to retrieve the value from.

Generics:

Type: T
A generic type parameter that allows the method's return type to be dynamically specified when called, adapting the result to that specific type.

Returns:

Type: T
The deserialized object or default(T) if conversion fails.

This is a sync method. Method runs synchronously.


GetValueAsDecimal(key)

Retrieves the value associated with the specified key as a decimal.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: decimal
The value associated with the specified key as a decimal. If the value is not a valid decimal, it returns default(decimal).

This is a sync method. Method runs synchronously.


GetValueAsUlong(key)

Retrieves the value associated with the specified key as a ulong.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: ulong
The value associated with the specified key as a ulong. If the value is not a valid ulong, it returns default(ulong).

This is a sync method. Method runs synchronously.


GetValueAsDouble(key)

Retrieves the value associated with the specified key as a double.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: double
The value associated with the specified key as a double. If the value is not a valid double, it returns default(double).

This is a sync method. Method runs synchronously.


GetValueAsT<T>(key)

Retrieves the value associated with the specified key and converts it to the specified type T.

Parameters:

key (required): string
The key to retrieve the value from.

Generics:

Type: T
A generic type parameter that allows the method's return type to be dynamically specified when called, adapting the result to that specific type.

Returns:

Type: T
The converted value or default(T) if conversion fails.

This is a sync method. Method runs synchronously.


GetValueJsonAsType(key, type)

Deserializes a JSON string stored under the given key into an object of the specified type.

Parameters:

key (required): string
The key to retrieve the value from.

type (required): string
The target type for deserialization.

Returns:

Type: object
The deserialized object or default(type) if conversion fails.

This is a sync method. Method runs synchronously.


GetValueAsTimeSpan(key)

Retrieves the value associated with the specified key as a TimeSpan.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: TimeSpan
The value associated with the specified key as a TimeSpan. If the value is not a valid TimeSpan, it returns default(TimeSpan).

This is a sync method. Method runs synchronously.


GetValueAsUshort(key)

Retrieves the value associated with the specified key as a ushort.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: ushort
The value associated with the specified key as a ushort. If the value is not a valid ushort, it returns default(ushort).

This is a sync method. Method runs synchronously.


GetValueAsFloat(key)

Retrieves the value associated with the specified key as a float.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: float
The value associated with the specified key as a float. If the value is not a valid float, it returns default(float).

This is a sync method. Method runs synchronously.


GetValueAsUint(key)

Retrieves the value associated with the specified key as a uint.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: uint
The value associated with the specified key as a uint. If the value is not a valid uint, it returns default(uint).

This is a sync method. Method runs synchronously.


GetValueAsDateTime(key)

Retrieves the value associated with the specified key as a DateTime.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: DateTimeOffset
The value associated with the specified key as a DateTime. If the value is not a valid DateTime, it returns default(DateTime).

This is a sync method. Method runs synchronously.


GetValueAsDateTimeOffset(key)

Retrieves the value associated with the specified key as a DateTimeOffset.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: DateTimeOffset
The value associated with the specified key as a DateTimeOffset. If the value is not a valid DateTimeOffset, it returns default(DateTimeOffset).

This is a sync method. Method runs synchronously.


GetValueAsSbyte(key)

Retrieves the value associated with the specified key as a sbyte.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: sbyte
The value associated with the specified key as a sbyte. If the value is not a valid sbyte, it returns default(sbyte).

This is a sync method. Method runs synchronously.


GetValueAsLong(key)

Retrieves the value associated with the specified key as a long.

Parameters:

key (required): string
The key to retrieve the value from.

Returns:

Type: long
The value associated with the specified key as a long. If the value is not a valid long, it returns default(long).

This is a sync method. Method runs synchronously.